import { reactive } from 'vue';
// npm install vuex --save
const state = reactive({
    actifications: [], // 存储通知数据的数组
});

const mutations = {
    addActification(state, actification) {
        console.log('????????',state.actifications)
        state.actifications.push(actification);
    },
    deleteActification(state, actificationId) {
        state.notifications = state.notifications.filter(item => item.id !== actificationId);
    },
};

const actions = {
    addActification({ commit }, actification) {
        commit('addActification', actification);
    },
    deleteActification({ commit }, actificationId) {
        commit('deleteActification', actificationId);
    },
};
const getters = {
    getActifications: state => state.actifications
};
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
};